#include <stdio.h>

struct XJA1{
	int a;
	char b;
	char c;
	short d;
};

struct XJA2{
	char a;
	char b;
	short c;
	int d;
};

int main(int argc, const char *argv[])
{
	struct XJA1 x1;
	x1.a = 0x12345678;
	x1.b = 0x11;
	x1.c = 0x22;
	x1.d = 0x3344;
	
	struct XJA1 *p1 = &x1;
	printf("%#x\n", p1->a); // 0x12345678
	printf("%#x\n", p1->b); // 0x11
	printf("%#x\n", p1->c); // 0x22
	printf("%#x\n", p1->d); // 0x3344
	
	printf("-------------------------------\n");

	struct XJA2 *p2 = (struct XJA2 *)&x1;
	printf("%#x\n", p2->a); // 0x78
	printf("%#x\n", p2->b); // 0x56
	printf("%#x\n", p2->c); // 0x1234
	printf("%#x\n", p2->d); // 0x33442211
	
	return 0;
}
